
// =================================================================== 
// class description : 
// =================================================================== 
// File: ViolationNotice.cs
// Copyright  @ AC
// History:
// 		2012/7/25  created by 
// 
// =================================================================== 
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;

namespace InternalManagementSystem.DAO.Models
{
    /// <summary>
    ///
    /// </summary>
    public class ViolationNotice
    {
        #region Private Variables

        private System.Int32 _id;

        private System.Int32 _userID;

        private System.Int32 _companyID;

        private System.Int32 _committer;

        private System.DateTime _commitDate;

        private System.String _noticeNo = string.Empty;

        private System.DateTime _violationDate;

        private System.String _address = string.Empty;

        private System.String _details = string.Empty;


        #endregion

        #region Constructors

        public ViolationNotice()
        {
        }

        public ViolationNotice(System.Int32 id)
        {
            _id = id;

        }

        public ViolationNotice(bool populateDefaultValue)
            : this()
        {
            if (populateDefaultValue)
            {
                _id = 0;
                _userID = 0;
                _companyID = 0;
                _noticeNo = string.Empty;
                _violationDate = DateTime.MinValue;
                _address = string.Empty;
                _details = string.Empty;
            }
        }

        public ViolationNotice(
            System.Int32 id,
            System.Int32 userID,
            System.Int32 companyID,
            System.String noticeNo,
            System.DateTime violationDate,
            System.String address,
            System.String details
        )
        {
            _id = id;
            _userID = userID;
            _companyID = companyID;
            _noticeNo = noticeNo;
            _violationDate = violationDate;
            _address = address;
            _details = details;

        }

        #endregion

        #region Properties

        public System.Int32 ID
        {
            get { return _id; }
            set { _id = value; }
        }

        public System.Int32 UserID
        {
            get { return _userID; }
            set { _userID = value; }
        }

        public System.Int32 CompanyID
        {
            get { return _companyID; }
            set { _companyID = value; }
        }

        public System.String NoticeNo
        {
            get { return _noticeNo; }
            set { _noticeNo = value; }
        }

        public System.DateTime ViolationDate
        {
            get { return _violationDate; }
            set { _violationDate = value; }
        }

        public System.String Address
        {
            get { return _address; }
            set { _address = value; }
        }

        public System.String Details
        {
            get { return _details; }
            set { _details = value; }
        }

        public int Committer
        {
            get { return _committer; }
            set { _committer = value; }
        }

        public DateTime CommitDate
        {
            get { return _commitDate; }
            set { _commitDate = value; }
        }

        
        #endregion
    }

    /// <summary>
    /// 
    /// </summary>
    public class ViolationNoticeCollection : CollectionBase
    {
        public ViolationNotice this[int index]
        {
            get
            {
                return ((ViolationNotice)(List[index]));
            }
            set
            {
                List[index] = value;
            }
        }

        public void Add(ViolationNotice item)
        {
            if ((item == null))
            {
                throw new System.Exception("can't add null into collection");
            }
            else
            {
                try
                {
                    List.Add(item);
                }
                catch (NotSupportedException ex)
                {
                    throw new System.Exception((ex.Message + ex.StackTrace));
                }
            }
        }
    }
}